package com.cola.aop;

import org.junit.jupiter.api.Test;

import java.io.InputStream;

/**
 * @Grup:com.cola.aop
 * @Auther:cola
 * @Data:2021/4/7-2021-04-23:09
 * @version:1.0
 */
public class aopTest {
    @Test
    public void test(){
        //1.读取配置文件
        InputStream in =Thread.currentThread().getContextClassLoader().getResourceAsStream("bean.properties");
        //2.创建Bean的工厂对象
        BeanFactory beanFactory=new BeanFactory(in);
        //3.获取代理对象
        ProxyFactoryBean proxyFactoryBean = (ProxyFactoryBean) beanFactory.getBean("bean");
        IManager proxy = (IManager) proxyFactoryBean.getProxy();
        proxy.add("我是一直猫");
    }
}
